import { Component } from '@angular/core';
import { Platform, NavController, AlertController, NavParams } from 'ionic-angular';
import { PubApi } from '../../providers/pubapi';

@Component({
    selector: 'page-newdetail',
    templateUrl: 'newdetail.html'
})


export class newdetailPage {
    public new: any;//新闻标题
    public newConten:any;//新闻内容
    public EditDate:any;//新闻编辑日期

    constructor(public platform: Platform, public navParams: NavParams, public pubapi: PubApi) {

        platform.ready().then(() => { });

        this.new = navParams.get("new");

    }


    ionViewDidEnter() {
  var that =this;
          this.pubapi.get("BlocNews/SelectAll", function (res) {
            let r = res.data;
            r.forEach((item) => {
                if(item.NewsTitle==that.new)
                {
                   that.newConten= item.NewsContent;
                    that.EditDate= item.EditDate;

                }
              
            })
           
        })


    }
}

